'use strict';

const Sequelize = require('sequelize');
const sequelize = require('../plugins/db');

const Model = Sequelize.Model;
class Navigation extends Model {}

// 静态属性：主键字段名称
Navigation.pk = 'mid';
Navigation.init({
  mid: {
    type: Sequelize.INTEGER,
    autoIncrement: true,
    primaryKey: true,
    comment: '菜单mid'
  },
  name: {
    type: Sequelize.STRING,
    allowNull: false,
    comment: '菜单名称'
  },
  position: {
    type: Sequelize.STRING,
    comment: '菜单位置'
  },
  content: {
    type: Sequelize.JSON,
    comment: '内容'
  }
}, {
    sequelize,
    tableName: 'navigation',
    freezeTableName: true,
    timestamps: true,
    // paranoid: true
    // createdAt: 'create_time',
    // updatedAt: 'update_time',
});
module.exports = Navigation;
